/**
 * 
 * 客户列表 医生
 * 
 * */
import React, { useCallback, useMemo, useState } from 'react';
import Header from '@/component/layout/Header/Header';
import ListTitle from "@/component/layout/ListTitle/ListTitle";
import CommonList from '@/component/common/CommonList/CommonList';
import qs from "querystring";
import { getDoctorAction } from '@/network/protocol';
import DocList from './DocList';

import './style.less';
const img1 = <img alt="" className="edit" src={require('../../assests/img/edit.png')} />
const pageSize = 20;

const DocListAnalysis = (props) => {
  const { location } = props;
  const saleId = useMemo(() => {
    let search = location.search;
    if (!search) return;
    let str = search.slice(1);
    let param = qs.parse(str);
    return param.saleId
  }, [location.search])

  const [param, setParam] = useState({ pageIndex: 1, pageSize, saleId })
  const update = useCallback(() => {
    setParam({ ...param, pageIndex: param.pageIndex + 1 })
  }, [param])

  const meetingType = useMemo(() => {
    return ['全国会', '区域会', '城市会']
  }, [])


  // const DocList = useCallback((props) => {
  //   const { data } = props;
  //   return <div className="Customer-list-item">
  //     <p className="p1">
  //       <span>姓名：{data.doctorName}</span>
  //       <span>医院：--</span>
  //     </p>
  //     <p className="p1">
  //       <span>门诊量：{data.doctorName}</span>
  //       <span>参会总次数：{data.meetingTimes}</span>
  //     </p>
  //     <p className="p2">
  //       <span>浏览次数：{data.futureTimes}</span>
  //       <span>浏览时长：0</span>
  //     </p>
  //   </div>
  // }, [])

  return <>
    <Header center={<span>客户管理</span>} />
    <div className="global-content CustomerAnalysis-box">
      <div className="header-box">
        <ListTitle img={img1} text={'医生分析'} />
        {/* <div className="select-box">
          <p>地区选择</p>
          <img src={require('../../assests/img/down.png')} alt="" />
        </div> */}
      </div>
      <div className="list-box">
      <CommonList mapkey="doctorId" update={update} param={param} viewCmp={DocList} method={getDoctorAction} />
      </div>

    </div>
  </>

}


export default React.memo(DocListAnalysis)

